<?php
declare (strict_types=1);

namespace app\controller\api;

use app\common\service\face\ClientTest;
use app\common\service\face\CompareFaces;
use app\common\service\sim\OpenSim;
use app\util\Strs;
use think\Exception;
use think\facade\App;
use think\Response;

class Miss extends Base {

    public function index(): Response {
        $version = config('apiadmin.APP_VERSION');
        if (!$version) {
            throw new Exception('请先执行安装脚本，完成项目初始化！');
        } else {
            return $this->buildSuccess([
                'Product'    => config('apiadmin.APP_NAME'),
                'ApiVersion' => $version,
                'TpVersion'  => App::version(),
                'Company'    => config('apiadmin.COMPANY_NAME'),
            ]);
        }
    }

    // public function getSim(): Response {
    //     $sim = new OpenSim();
    //     $res = $sim->setUrl('/simipass/api/estate/door/platformEstateOpen')
    //         ->setMethod('POST')
    //         ->setParams([
    //             'phone' => '19521140287',
    //             'estateId' => '0100000149',
    //             'transactionId' => Strs::randString(12, 1)
    //         ])->request();
    //     dump("res:",$res);
    //     $sim->close();
    //     exit();
    // }
}
